import { Socket } from "./socket";

let port = 8102;

let socket = new Socket();
socket.init(port)

console.log("start", `:${port}`)

// let media_server = new NodeMediaServer({
//     rtmp: {
//         port: 1935,
//         chunk_size: 60000,
//         gop_cache: true,
//         ping: 30,
//         ping_timeout: 60
//     },
//     http: {
//         port: 8000,
//         allow_origin: '*',
//         mediaroot: './'
//     }
// });


//media_server.run();

function shutdown() {
    console.log("程序退出")
    socket.close();
    //media_server.stop();
    process.exit(1);
}
process.on("SIGINT", shutdown)
process.on("SIGTERM", shutdown)

